/**
 * Generate code from /{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/domain/{{entities@NONE}}.java.hbs
 */
package cn.ibizlab.core.system.domain;

import java.util.*;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.util.*;
import org.springframework.data.annotation.*;
import cn.ibizlab.util.annotation.*;
import cn.ibizlab.util.enums.*;
import cn.ibizlab.util.domain.IEntity;
import cn.ibizlab.util.domain.EntityBase;
import java.io.Serializable;
import lombok.*;
import lombok.experimental.Accessors;
import io.swagger.annotations.*;
import cn.ibizlab.core.system.domain.SysApi;
import cn.ibizlab.core.system.domain.SysComponentApi;
import cn.ibizlab.core.system.domain.SysDataScope;

/**
 * 接口方法实体类[SysApiOperation]
 *
 * @author generator
 */
@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
@JsonIgnoreProperties(value = "handler")
@ApiModel(value = "SYS_API_OPERATION", description = "接口方法")
public class SysApiOperation extends EntityBase implements Serializable
{

    /**
     * 标识
     */
    @Id
    @DEField(name = "id" , isKeyField = true)
    @JsonProperty("id")
    @JSONField(name = "id")
    @ApiModelProperty(value = "id", notes = "标识")
    private String id;

    /**
     * 代码名
     */
    @DEField(name = "code_name")
    @JsonProperty("code_name")
    @JSONField(name = "code_name")
    @ApiModelProperty(value = "code_name", notes = "代码名")
    private String codeName;

    /**
     * 接口标识
     */
    @DEField(name = "api_id")
    @JsonProperty("api_id")
    @JSONField(name = "api_id")
    @ApiModelProperty(value = "api_id", notes = "接口标识")
    private String apiId;

    /**
     * 路径
     */
    @DEField(name = "path")
    @JsonProperty("path")
    @JSONField(name = "path")
    @ApiModelProperty(value = "path", notes = "路径")
    private String path;

    /**
     * 显示名
     */
    @DEField(name = "notes")
    @JsonProperty("notes")
    @JSONField(name = "notes")
    @ApiModelProperty(value = "notes", notes = "显示名")
    private String notes;

    /**
     * 描述
     */
    @DEField(name = "description")
    @JsonProperty("description")
    @JSONField(name = "description")
    @ApiModelProperty(value = "description", notes = "描述")
    private String description;

    /**
     * 范围
     */
    @DEField(name = "scopes")
    @JsonProperty("scopes")
    @JSONField(name = "scopes")
    @ApiModelProperty(value = "scopes", notes = "范围")
    private List<SysDataScope> scopes;

    /**
     * 接口
     */
    @JSONField(name = "api")
    @JsonProperty("api")
    @ApiModelProperty(value = "api", notes = "接口")
    private SysApi api;


    /**
     * 复制当前对象数据到目标对象(粘贴重置)
     * @param targetEntity 目标数据对象
     * @param includeEmpty  是否包括空值
     * @param <T>
     * @return
     */
    @Override
    public <T> T pasteTo(T targetEntity, boolean includeEmpty) {
        super.pasteTo(targetEntity, includeEmpty);
        if(targetEntity instanceof IEntity) {
            IEntity entity = ((IEntity) targetEntity);
            entity.reset("id");
        }
        return targetEntity;
    }

}